<?php if (!defined('THINK_PATH')) exit();?><!--<meta http-equiv="refresh" content="1"/>-->
<link href="/Public/Admin/css/same.css"  type="text/css" rel="stylesheet"/>
<script src="/Public/js/jquery-1.11.3.min.js" type="text/javascript"></script>
<link href="/Public/css/bootstrap.css"  type="text/css" rel="stylesheet"/>
<script src="/Public/js/bootstrap.js" type="text/javascript"></script>
<script src="/Public/js/layer/layer.js" type="text/javascript"></script>
<script src="/Public/Admin/js/BookEntering.js" type="text/javascript"></script>
<div class="a-main-left-content">
    <div class="a_con_title">
        <h4>书籍编辑</h4>
    </div>
    <div class="a_title_tip">
        <img class="a_record_icon" src="/Public/img/record_01.jpg"/>
        <span class="a_record_news">请认真核对数据，以免出现问题。</span>
    </div>

    <div class="enter_box">
        <form action="<?php echo U('Admin/BookManage/bookShowSave');?>" method="post">
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span><c>*</c>图书名称：</span>
                </div>
                <div class="enter_input">
                    <input type="text" name="book_name" id="book_name" value="<?php echo ($_getBookSaveInfo['book_name']); ?> ">
                    <button type="button" id="enter_create1" class="check"  data-book-id="<?php echo ($_getBookSaveInfo['book_id']); ?>">名称校验</button>
                    <input type="hidden" value="<?php echo U('Admin/BookManage/getBookNamecheck');?>" id="check-url">
                </div>
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>图书类型：</span>
                </div>
                <select name="book_type_id">
                    <?php if(is_array($_getBookTypeTableInfo)): $i = 0; $__LIST__ = $_getBookTypeTableInfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo['book_type_id']); ?>" <?php if( $_getBookSaveInfo['book_type_id'] == $vo['book_type_id']): ?>selected<?php endif; ?> ><?php echo ($vo['book_type_name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>出版社：</span>
                </div>
                <select name="book_isbn_id">
                    <?php if(is_array($_getBookIsbnTableInfo)): $i = 0; $__LIST__ = $_getBookIsbnTableInfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$fo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($fo['book_isbn_id']); ?>" <?php if( $_getBookSaveInfo['book_isbn_id'] == $fo['book_isbn_id']): ?>selected<?php endif; ?> ><?php echo ($fo['book_isbn_name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>书架名称：</span>
                </div>
                <select name="book_case_id">
                    <?php if(is_array($_getBookCaseTableInfo)): $i = 0; $__LIST__ = $_getBookCaseTableInfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$zo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($zo['book_case_id']); ?>" <?php if( $_getBookSaveInfo['book_case_id'] == $zo['book_case_id']): ?>selected<?php endif; ?>  ><?php echo ($zo['book_case_name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
            <div class="enter_min_box book_save_show" >
                <div class="enter_span">
                    <span><c>*</c>条形码：</span>
                </div>
                <input type="text" name="book_barcode" readonly="" value="<?php echo ($_getBookSaveInfo['book_barcode']); ?>" class="record_save_color" id="input_create">
                <!--<button type="button" id="enter_create" onclick="randomkeys()">随机生成</button>-->
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span><c>*</c>图书作者：</span>
                </div>
                <input type="text" name="book_author" value="<?php echo ($_getBookSaveInfo['book_author']); ?>">
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>图书翻译者：</span>
                </div>
                <input type="text" name="book_translator" value="<?php echo ($_getBookSaveInfo['book_translator']); ?>">
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span><c>*</c>图书价格：</span>
                </div>
                <input type="text" name="book_price"  onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')" value="<?php echo ($_getBookSaveInfo['book_price']); ?>">
                <span>(单位：元)</span>
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span><c>*</c>剩余数量：</span>
                </div>
                <input type="text" name="book_number" onkeyup="value=this.value.replace(/\D+/g,'')" value="<?php echo ($_getBookSaveInfo['book_number']); ?>">
                <span>(单位：本)</span>
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>借阅数量：</span>
                </div>
                <input type="text" name="book_borrow" onkeyup="value=this.value.replace(/\D+/g,'')" value="<?php echo ($_getBookSaveInfo['book_borrow']); ?>" readonly="" class="record_save_color" >
                <span>(单位：本)</span>
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>销售数量：</span>
                </div>
                <input type="text" name="buy_book_number" onkeyup="value=this.value.replace(/\D+/g,'')" value="<?php echo ($_getBookSaveInfo['buy_book_number']); ?>" readonly="" class="record_save_color" >
                <span>(单位：本)</span>
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>录入者名称：</span>
                </div>
                <div class="xiu_gai record_save_color">
                    <?php if(is_array($_getAdminAllInfo)): $i = 0; $__LIST__ = $_getAdminAllInfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$qo): $mod = ($i % 2 );++$i; if( $_getBookSaveInfo['a_id'] == $qo['a_id']): echo ($qo['a_name']); endif; endforeach; endif; else: echo "" ;endif; ?>
                </div>
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>录入时间：</span>
                </div>
                <input type="text" name="book_intime" value="<?php echo (date('Y-m-d H:i:s',$_getBookSaveInfo['book_intime'])); ?>" readonly="" class="record_save_color">
            </div>
            <div class="enter_min_box book_save_show">
                <div class="enter_span">
                    <span>图书状态：</span>
                </div>
                <div class="xiu_gai record_save_color">
                    <?php if($_getBookSaveInfo['book_del'] == 1): ?>上架
                        <?php else: ?>
                        下架<?php endif; ?>
                </div>
            </div>
            <div class="enter_submit">
                <input type="submit" value="修&nbsp;改">
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    function randomkeys(){
        var rnd="";
        for(var i=0;i<4;i++){
            rnd+=Math.floor(Math.random()*1000000).toString(16);
        }
        document.getElementById('input_create').value=rnd;
    }
</script>